<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>数组</title>
    <script>
        // let colors = ["blue", "black"];
        // let newColors = colors.concat("yellow");
        // alert(newColors);//blue,black,yellow
        // let newColors2 = colors.concat("gray", ["yellow"]);
        // alert(newColors2);//blue,black,gray,yellow

        let colors2 = ["blue", "gray", "red", "yellow"];
        let newColors2 = colors2.slice(1);
        alert(newColors2); //gray,red,yellow
        let newColors3 = colors2.slice(1, 2);
        alert(newColors3);//gray




    </script>
</head>
<body>
操作方法
</body>
</html>